home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Erotic Games: Memory
/
Erotic Games: Memory.iso
/
mac
/
air_installers
/
AdobeAIR.exe
/
setup.swf
/
scripts
/
components
/
InstallerApplication.as
next >
Wrap
Text File
|
2009-02-12
|
5KB
|
130 lines
package components
{
import flash.desktop.NativeApplication;
import flash.system.Capabilities;
import mx.core.Application;
import mx.events.PropertyChangeEvent;
import mx.styles.CSSStyleDeclaration;
import mx.styles.StyleManager;
public class InstallerApplication extends Application
{
protected var _431873101locManager:LocalizationManager;
public function InstallerApplication()
{
this._431873101locManager = LocalizationManager.getInstance();
super();
}
private function applyToDeclaration(param1:CSSStyleDeclaration, param2:String, param3:Array) : void
{
var _loc4_:String = null;
var _loc5_:Array = null;
var _loc6_:String = null;
var _loc7_:String = null;
if(!param1)
{
return;
}
for each(_loc6_ in param3)
{
_loc4_ = null;
if(_loc6_ == "fontFamily" && Capabilities.os.indexOf("Mac") >= 0)
{
_loc7_ = this.locManager.localeChain[0];
switch(_loc7_)
{
case "ja":
case "ko":
case "zh_Hans":
case "zh_Hant":
_loc4_ = this.locManager.getString(param2 + "fontFamilyMac","CSS",null,false);
}
}
if(_loc4_ == null)
{
_loc4_ = this.locManager.getString(param2 + _loc6_,"CSS",null,false);
}
if(_loc4_)
{
if((_loc4_ = _loc4_.replace(/"/gi,"")).match(/,/))
{
_loc4_ = _loc4_.replace(/\s*,\s*/gi,",");
param1.setStyle(_loc6_,_loc4_.split(","));
}
else if(_loc6_.indexOf("padding") >= 0)
{
param1.setStyle(_loc6_,int(_loc4_));
}
else
{
param1.setStyle(_loc6_,_loc4_);
}
}
}
}
public function activate() : void
{
stage.nativeWindow.activate();
NativeApplication.nativeApplication.activate();
}
public function get stageHeight() : Number
{
return stage.stageHeight;
}
public function updateStylesForLocale() : void
{
var _loc1_:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Application");
var _loc2_:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Button");
var _loc3_:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CheckBox");
var _loc4_:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".h1");
var _loc5_:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".h2");
var _loc6_:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".formItemText");
this.applyToDeclaration(_loc1_,"Application-",["fontFamily","fontSize"]);
this.applyToDeclaration(_loc2_,"Button-",["fontFamily","fontSize","fontWeight","paddingTop","paddingBottom","paddingLeft","paddingRight"]);
this.applyToDeclaration(_loc3_,"CheckBox-",["fontFamily","fontSize","fontWeight"]);
this.applyToDeclaration(_loc4_,"h1-",["fontFamily","fontSize","fontWeight","leading"]);
this.applyToDeclaration(_loc5_,"h2-",["fontFamily","fontSize","fontWeight","leading"]);
this.applyToDeclaration(_loc6_,"formItemText-",["fontWeight"]);
}
[Bindable(event="propertyChange")]
public function set stageHeight(param1:Number) : void
{
var _loc2_:Object = this.stageHeight;
if(_loc2_ !== param1)
{
this._318928443stageHeight = param1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"stageHeight",_loc2_,param1));
}
}
protected function set locManager(param1:LocalizationManager) : void
{
var _loc2_:Object = this._431873101locManager;
if(_loc2_ !== param1)
{
this._431873101locManager = param1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"locManager",_loc2_,param1));
}
}
private function set _318928443stageHeight(param1:Number) : void
{
stage.stageHeight = param1;
}
[Bindable(event="propertyChange")]
protected function get locManager() : LocalizationManager
{
return this._431873101locManager;
}
}
}